home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
ndr3.exe
/
VERNETX.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-04
|
2KB
|
65 lines
/*
VERNETX.C shows how to obtain the NETX version number
directly. This is a documented call, though
the EMSNETX/XMSNETX flag is not widely known.
Author: Tim Farley
Copyright 1993, Tim Farley, All Rights Reserved
*/
#include <stdlib.h> /* for NULL */
#ifdef __TURBOC__
#define ASM asm
#else
/* assume Microsoft C if not Turbo/Borland C */
#define ASM _asm
#endif
/*
GetNetWareShellVersion is similar to the function of the same
name from the old C Interface for DOS
libraries.
Two differences: (1) it returns the version number directly
as the function return value, to act like the other
functions in this program. (2) it also returns an
additional parameter, shellType, which indicates if it
EMSNETX or XMSNETX are present.
*/
int GetNetWareShellVersion( int * revLevel, int * shellType )
{
char buffer[ 40 ];
int netxVer, netxRev, netxType;
ASM {
push di /* save C's registers */
push si
mov ax,ss
mov es,ax
lea di,buffer /* ES:DI -> buffer */
xor bx,bx
mov cx,bx
mov ax,0EA01h /* Func EA01: Get Shell Version Info */
int 21h
mov netxVer,bx /* store return values */
mov al,cl
xor ah,ah
mov netxRev,ax
mov al,ch
mov netxType,ax
pop si /* restore C's registers */
pop di
}
if ( netxVer ) {
*revLevel = netxRev;
*shellType = netxType;
}
return ( netxVer );
} /* GetNetWareShellVersion() */
/* eof: VERNETX.C */